home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* */
- /* Are you tired of Waiting for Mr. Goodcarriage return then */
- /* Strike Any Key back with this example of VT52 cursor control */
- /* sequences... For further information refer to the VT100 users */
- /* guide and/or the Hitchhiker's Guide to the BIOS... */
- /* CONOUT Escape Sequences....page 24 */
- /* */
- /************************************************************************/
-
- /************************************************************************/
- /************************************************************************/
- /* VT52.H */
- /* VT52 Escape Sequences */
- /************************************************************************/
- /************************************************************************/
-
- #define UP_CURSOR "\033A" /* Cursor Up <ESC>A */
- #define DWN_CURSOR "\033B" /* Cursor Down <ESC>B */
- #define FWD_CURSOR "\033C" /* Cursor Forward <ESC>C */
- #define BKW_CURSOR "\033D" /* Cursor Backward <ESC>D */
- #define CLR_SRCEEN "\033E" /* Clear Screen and Home Cursor <ESC>E */
- #define HOM_CURSOR "\033H" /* Home Cursor <ESC>H */
- #define REV_INDEX "\033I" /* Reverse Index <ESC>I */
- #define ERA_EPAGE "\033J" /* <ESC>J */
- /* Erase from Cursor position to end of Page */
- #define CLR_EOL "\033K" /* Clear to End of Line <ESC>K */
- #define INS_LINE "\033L" /* Insert Line <ESC>L */
- #define DEL_LINE "\033M" /* Delete Line <ESC>M */
- #define POS_CURSOR "\033Y" /* Position Cursor Row/Column */
- /* <ESC>Y P1;P2 (P1=\040+ROW P2=\040+COL) */
- #define FOR_COLOR "\033b" /* Set Forground Color */
- /* <ESC>b P1 (P1=\020+COLOR) */
- #define BAK_COLOR "\033c" /* Set Background Color */
- /* <ESC>c P1 (P1=\020+COLOR) */
- #define ERA_BPAGE "\033d" /* <ESC>d */
- /* Erase from Begining of Page to Cursor position */
- #define ENA_CURSOR "\033e" /* Enable Cursor <ESC>e */
- #define DIS_CURSOR "\033f" /* Disable Cursor <ESC>f */
- #define SAV_CURSOR "\033j" /* Save Cursor Position <ESC>j */
- #define RST_CURSOR "\033k" /* Restore Cursor Position <ESC>k */
- #define ERA_ELINE "\033l" /* Erase Entire Line <ESC>l */
- #define ERA_BLINE "\033o" /* Erase Begining of Line <ESC>o */
- #define ON_IVIDEO "\033p" /* Enter Reverse Video Mode <ESC>p */
- #define OFF_IVIDEO "\033q" /* Exit Reverse Video Mode <ESC>q */
- #define WRAP_EOL "\033v" /* Wrap at End of Line <ESC>v */
- #define DIS_EOL "\033w" /* Discard at End of Line <ESC>w */
- #define BELL "\007" /* Ring Bell ^G */
-
-
- /************************************************************************/
- /************************************************************************/
- /* COLORS.H */
- /************************************************************************/
- /************************************************************************/
-
- #define WHITE 0
- #define BLACK 1
- #define RED 2
- #define GREEN 3
- #define BLUE 4
- #define CYAN 5
- #define YELLOW 6
- #define MAGENTA 7
- #define LWHITE 8
- #define LBLACK 9
- #define LRED 10
- #define LGREEN 11
- #define LBLUE 12
- #define LCYAN 13
- #define LYELLOW 14
- #define LMAGENTA 15
-
-
- /************************************************************************/
- /************************************************************************/
- /* WAIT.C */
- /************************************************************************/
- /************************************************************************/
-
- #include <osbind.h>
-
- #define P_BOT_CURSOR "\033\131\070\040" /* <ESC>Y Set Cursor Pos */
- #define void /**/ /* at Bottom of Screen */
-
-
- char MSG0[] = "<<<<<<<<<<<<<<<<<<<<<<<<<<< ";
- char MSG1[] = "STRIKE ANY KEY TO CONTINUE";
- char MSG2[] = " >>>>>>>>>>>>>>>>>>>>>>>>>>>";
-
- main()
- {
- int i, j;
- j = 0;
-
- display(BELL);
- display(DIS_CURSOR);
- while (!Bconstat(2)) /* Wait for Keyboard entry */
- {
- for(i = 0; i <= 20000; ++i);
- ++j;
- display(P_BOT_CURSOR);
- display(MSG0);
- display(ON_IVIDEO);
- display(MSG1);
- display(OFF_IVIDEO);
- display(MSG2);
- for(i = 0; i <= 20000; ++i);
- display(P_BOT_CURSOR);
- display(MSG0);
- display(MSG1);
- display(MSG2);
- if(j == 36) /* Ring BELL every 10 sec */
- {
- display(BELL);
- j = 0;
- }
- }
- display(ENA_CURSOR);
- Pterm0();
- }
-
- static void display(s)
- char *s;
- {
- while (*s) Bconout(2, *s++);
- }
-